import Home from "../view/home/Home"
import Login from "../view/Login"
import Welcome from "../view/home/Welcome"
import Homeuser from "../view/home/homelist/Homeuser"
import Homeimpower from "../view/home/homelist/Homeimpower"
import Homemenu from "../view/home/homelist/Homemenu"
import Perages from "../view/home/personnel/Perages"
import Permajor from "../view/home/personnel/Permajor"
import Perpupil from "../view/home/personnel/Perpupil"
import Perunit from "../view/home/personnel/Perunit"
import Perstaff from "../view/home/personnel/Perstaff"
import Perclient from "../view/home/client/Perclient"
import Unitarea from "../view/home/perunit/Unitarea"
import Unitrooms from "../view/home/perunit/Unitrooms"
import Percard from "../view/home/percard/Percard"
import Percardblack from "../view/home/percard/Percardblack"
import InfoMessage from '../view/home/information/InfoMessage'
import InfoModule from '../view/home/information/InfoModule'
import InfoPush from '../view/home/information/InfoPush'
import Unitcontroller from "../view/home/perunit/Unitcontroller"
import Unitguards from "../view/home/perunit/Unitguards"
import Unitscheme from "../view/home/perunit/Unitscheme"
import IdentifyTheRecord from "../view/home/facerecognition/dataanalyze/IdentifyTheRecord"
import AccessRecords from "../view/home/facerecognition/dataanalyze/AccessRecords"
import Faceauthorization from '../view/home/facerecognition/faceadministration/Faceauthorization'
import FaceModeling from '../view/home/facerecognition/faceadministration/FaceModeling'
import WeekPlay from '../view/home/facerecognition/weekplay/WeekPlay'
import Administration from '../view/home/facerecognition/permissiongroup/Administration'
import Setting from '../view/home/facerecognition/permissiongroup/Setting'
import BindingPersonnel from '../view/home/facerecognition/permissiongroup/BindingPersonnel'
import ParameterSetting from '../view/home/systemmanagement/parametersetting/ParameterSetting'
import FunctionMenu from '../view/home/systemmanagement/functionmenu/FunctionMenu'
import UserAdmin from '../view/home/systemmanagement/useradmin/UserAdmin'
import ClientAdministration from '../view/home/systemmanagement/clientadministration/ClientAdministration'
import DataDictionaries from '../view/home/systemmanagement/datadictionaries/DataDictionaries'
import OrganAccredit from '../view/home/systemmanagement/accreditadmin/OrganAccredit'
import AreaAccredit from '../view/home/systemmanagement/accreditadmin/AreaAccredit'
import Accesser from "../view/home/facerecognition/dataanalyze/Access"
import DoorAccredit from '../view/home/entranceguardadmin/cldoudadmin/dooraccredit/DoorAccredit'
import PeopleAccredit from '../view/home/entranceguardadmin/cldoudadmin/peopleaccredit/PeopleAccredit'
import TimeScheme from '../view/home/facerecognition/timescheme/TimeScheme'
import Roster from '../view/home/entranceguardadmin/cldoudadmin/offline/Roster'
import Firealarmfunc from '../view/home/entranceguardadmin/cldoudadmin/offline/Firealarmfunc'
import Specialdate from '../view/home/entranceguardadmin/cldoudadmin/offline/Specialdate'
import Firealarmarea from '../view/home/entranceguardadmin/cldoudadmin/offline/Firealarmarea'
import Gothrough from '../view/home/entranceguardadmin/dataanalyze/Gothrough'
import Funcrecord from '../view/home/entranceguardadmin/dataanalyze/Funcrecord'
import AccessTurnover from '../view/home/entranceguardadmin/dataanalyze/AccessTurnover'
import MocksunSetting from "../view/home/entranceguardadmin/offlineadmin/MocksunSetting"
import PermissionSet from "../view/home/entranceguardadmin/offlineadmin/PermissionSet"
import OffLine from "../view/home/entranceguardadmin/offlineadmin/OffLine"
import PermissionAuth from "../view/home/entranceguardadmin/offlineadmin/PermissionAuth"
import PerCapita from "../view/home/entranceguardadmin/offlineadmin/PerCapita"
import GoThroughs from "../view/home/entranceguardadmin/offlineadmin/GoThroughs"
import TimeDownload from "../view/home/entranceguardadmin/offlineadmin/TimeDownload"
import YunMocksunSetting from '../view/home/entranceguardadmin/cldoudadmin/offline/YunMocksunSetting'
import PassageOfTime from '../view/home/entranceguardadmin/cldoudadmin/offline/PassageOfTime'
import NotFound from '../view/home/404'

export function usersRoute(){
  let menuList = JSON.parse(sessionStorage.getItem("menu"))
  let usersRoutes = []
  const recursionRoute = (menuList) => {
    menuList.forEach((item) => {
      if (item.url) {
        usersRoutes.push(item.url)
      }
      if (item.children) {
        recursionRoute(item.children)
      }

    })
  }
  recursionRoute(menuList)
  return usersRoutes
}
export const list = [{
  path: "/system/user",
  component: Homeuser,
  meta: {
    requireAuth: true
  },
},
{
  path: "/system/roleAccredit",
  component: Homeimpower,
  meta: {
    requireAuth: true
  },
},
{
  path: "/menu",
  component: Homemenu,
  meta: {
    requireAuth: true
  },
},
{
  path: "/grade",
  component: Perages,
  meta: {
    requireAuth: true
  },
},
{
  path: "/major",
  component: Permajor,
  meta: {
    requireAuth: true
  },
},
{
  path: "/pupil",
  component: Perpupil,
  meta: {
    requireAuth: true
  },
},
{
  path: "/unit",
  component: Perunit,
  meta: {
    requireAuth: true
  },
},
{
  path: "/staff",
  component: Perstaff,
  meta: {
    requireAuth: true
  },
},
{
  path: '/client',
  component: Perclient,
  meta: {
    requireAuth: true
  },
},
{
  path: '/dev/area',
  component: Unitarea,
  meta: {
    requireAuth: true
  },
},
{
  path: '/welcome',
  component: Welcome,
  meta: {
    requireAuth: true
  },
},
{
  path: '/dev/rooms',
  component: Unitrooms,
  meta: {
    requireAuth: true
  },
},
{
  path: '/dev/controller',
  component: Unitcontroller,
  meta: {
    requireAuth: true
  },
},
{
  path: '/dev/gate',
  component: Unitguards,
  meta: {
    requireAuth: true
  },
},
{
  path: '/timeScheme',
  component: Unitscheme,
  meta: {
    requireAuth: true
  },
},
{
  path: '/card/oper',
  component: Percard,
  meta: {
    requireAuth: true
  },
},
{
  path: '/card/blacklist',
  component: Percardblack,
  meta: {
    requireAuth: true
  },
},
{
  path: '/wechat/user',
  component: InfoMessage,
  meta: {
    requireAuth: true
  },
},
{
  path: '/wechat/messageTemplate',
  component: InfoModule,
  meta: {
    requireAuth: true
  },
},
{
  path: '/wechat/pushRecord',
  component: InfoPush,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/record',
  component: IdentifyTheRecord,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/trafficRecord',
  component: AccessRecords,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/authorization',
  component: Faceauthorization,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/modeling',
  component: FaceModeling,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/weekplan',
  component: WeekPlay,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/group',
  component: Administration,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/group/config',
  component: Setting,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/group/access',
  component: BindingPersonnel,
  meta: {
    requireAuth: true
  },
},
{
  path: '/system/parameterSetting',
  component: ParameterSetting,
  meta: {
    requireAuth: true
  },
},
{
  path: '/system/functionmenu',
  component: FunctionMenu,
  meta: {
    requireAuth: true,
    perms:['sys:menu:add','sys:menu:update','sys:menu:del']
  },
},
{
  path: '/useradmin',
  component: UserAdmin,
  meta: {
    requireAuth: true
  },
},
{
  path: '/system/clientAdministration',
  component: ClientAdministration,
  meta: {
    requireAuth: true
  },
},
{
  path: '/system/dataDictionaries',
  component: DataDictionaries,
  meta: {
    requireAuth: true
  },
},
{
  path: '/system/organAccredit',
  component: OrganAccredit,
  meta: {
    requireAuth: true
  },
},
{
  path: '/system/areaAccredit',
  component: AreaAccredit,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/accessAnalysis',
  component: Accesser,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/cloud/doorAccredit',
  component: DoorAccredit,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/cloud/personAccredit',
  component: PeopleAccredit,
  meta: {
    requireAuth: true
  },
},
{
  path: '/face/timeScheme',
  component: TimeScheme,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/cloudOffline/namelist',
  component: Roster,
  meta: {
    requireAuth: true
  },
},
{

  path: '/alleyway/cloudOffline/fireEvent',
  component: Firealarmfunc,
  meta: {
    requireAuth: true
  },
},
{

  path: '/alleyway/cloudOffline/fireArea',
  component: Firealarmarea,
  meta: {
    requireAuth: true
  },
},

{

  path: '/alleyway/trafficRecord',
  component: Gothrough,
  meta: {
    requireAuth: true
  },
},
{

  path: '/alleywa/eventRecord',
  component: Funcrecord,
  meta: {
    requireAuth: true
  },
},

{

  path: '/alleyway/cloudOffline/specialdate',
  component: Specialdate,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/namelist',
  component: OffLine,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/groupAccess',
  component: PermissionAuth,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/personAuth',
  component: PerCapita,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/passagePeriod',
  component: GoThroughs,
  meta: {
    requireAuth: true
  },
},
{
  path:'/alleywa/accessAnalysis',
  component:AccessTurnover,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/timeDownload',
  component: TimeDownload,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/holiday',
  component: MocksunSetting,
  meta: {
    requireAuth: true
  },
},
{
  path: '/alleyway/offline/groupConfig',
  component: PermissionSet,
  meta: {
    requireAuth: true
  },
},

{

  path: '/alleyway/cloudOffline/holiday',
  component: YunMocksunSetting,
  meta: {
    requireAuth: true
  },
},
{

  path: '/alleyway/cloudOffline/passagePeriod',
  component: PassageOfTime,
  meta: {
    requireAuth: true
  },
}]
export const routes = [
  {
    path: "/",
    redirect: "/login"
  },
  {
    path: "/login",
    component: Login,
  },
  {
    path: "/home",
    component: Home,
    redirect: "/welcome",
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: '/welcome',
        component: Welcome,
        meta: {
          requireAuth: true
        },
      },
    ]
  },
  {
    path: "*",
    component: NotFound,
  }
]